<div class="row">
    <div class="col-xs-12 col-sm-12">
        <div class="table-responsive">
            <table  class="table table-bordered table-hover">
                <thead>
                <tr>
                    <th class="col-sm-1">序号</th>
                    <th class="col-sm-2">功能名称</th>
                    <th class="col-sm-1">菜单显示</th>
                    <th class="col-sm-2">链接地址</th>
                    <th class="col-sm-1">隶属</th>
                    <th class="col-sm-1">状态</th>
                    <th class="col-sm-1">排序</th>
                    <th class="col-sm-3">
                        <a class="blue" title="添加功能" href="/{{$_controller}}/add">
                            <i class="glyphicon glyphicon-plus bigger-130"></i>
                        </a>
                    </th>
                </tr>
                </thead>

                <tbody>
                {{foreach $rootMenu as $root}}
                <tr>
                    <td>{{$root['id']}}</td>
                    <td>
                        <i class="{{$root['icon']}}"></i>
                        {{str_replace('&nbsp;','',$root['name'])}}
                        {{if count($root['sub'])>0}}—
                            <a data-toggle="collapse" title="子菜单" href="#function_{{$root['id']}}">
                                <i class="glyphicon glyphicon-plus"></i>
                            </a>
                        {{/if}}
                    </td>

                    <td>
                        {{if $root['is_menu'] == 1}}
                            <a class="blue" href="javascript:del('/{{$_controller}}/setmenu?id={{$root['id']}}')">
						      <span title="点击取消菜单显示" class="badge badge-warning">是</span>
                            </a>
                        {{else}} 
                            <a class="blue" href="javascript:del('/{{$_controller}}/setmenu?id={{$root['id']}}')">
                                <span class="badge" title="点击设置菜单显示">否</span>
                            </a>
                        {{/if}}
                    </td>

                    <td>无</td>
                    <td>根</td>
                    <td>
                        {{if $root['status']==1}}
                            <a class="blue" href="javascript:del('/{{$_controller}}/lock?id={{$root['id']}}')">
                                <span title="点击锁定" class="badge badge-warning">正常</span>
                            </a>
                        {{else}}
                            <a class="blue" href="javascript:del('/{{$_controller}}/lock?id={{$root['id']}}')">
                                <span title="点击解锁" class="badge">锁定</span>
                            </a> 
                        {{/if}}
                    </td>

                    <td>{{$root['sort']}}</td>

                    <td>
                        <div class="action-buttons">
                        <a class="blue" title="菜单编辑" href="/{{$_controller}}/add?id={{$root['id']}}">
                            <i class="fa fa-pencil bigger-130"></i>
                        </a>

                        {{if $root['status']==1}}
                            <a class="blue" title="点击锁定" href="javascript:del('/{{$_controller}}/lock?id={{$root['id']}}')">
                            <i class="fa fa-unlock bigger-130"></i></a> 
                        {{else}}
                            <a class="blue" title="点击解锁" href="javascript:del('/{{$_controller}}/lock?id={{$root['id']}}')">
                            <i class=" fa fa-lock bigger-130"></i></a> 
                        {{/if}}

                        {{if count($root['sub'])==0}}
                            <a class="blue" title="删除" href="javascript:del('/{{$_controller}}/del?id={{$root['id']}}')">
                            <i class="fa fa-trash-o bigger-130"></i></a>
                        {{/if}}

                        <a class="blue" href="javascript:req('/{{$_controller}}/sort?type=up&id={{$root['id']}}')">
                            <i class="ace-icon glyphicon glyphicon-upload" title="排序上升"></i>
                        </a>

                        <a class="blue" href="javascript:req('/{{$_controller}}/sort?type=down&id={{$root['id']}}')">
                            <i class="ace-icon glyphicon glyphicon-download" title="排序下降"></i>
                        </a>

                        </div>
                    </td>
                </tr>

                {{if count($root['sub'])>0}}
                <tr style="padding:0px;margin:0px;">
                <td colspan="8" style="padding:0px;margin:0px;">

                    <table id="function_{{$root['id']}}" class="table table-bordered table-hover collapse" style="margin-bottom:0px;">
                        <thead>
                        <tr>
                            <th class="col-sm-1">子序号</th>
                            <th class="col-sm-2">功能名称</th>
                            <th class="col-sm-1">菜单显示</th>
                            <th class="col-sm-2">链接地址</th>
                            <th class="col-sm-1">隶属</th>
                            <th class="col-sm-1">状态</th>
                            <th class="col-sm-1">排序</th>
                            <th class="col-sm-3">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{foreach $root['sub'] as $child}}
                        <tr>
                            <td>{{$child['id']}}</td>
                            <td>
                                <i class="glyphicon glyphicon-play-circle"></i>—{{$child['name']}}
                            </td>
                            <td>
                                {{if $child['is_menu']==1}}
                                <a class="blue" href="javascript:del('/{{$_controller}}/setmenu?id={{$child['id']}}')">
                                    <span title="点击取消菜单显示" class="badge badge-warning">是</span>
                                </a>
                                {{else}}
                                <a class="blue" href="javascript:del('/{{$_controller}}/setmenu?id={{$child['id']}}')">
                                    <span class="badge" title="点击设置菜单显示">否</span>
                                </a>
                                {{/if}}
                            </td>
                            <td>/{{$child['controller']}}/{{$child['action']}}</td>
                            <td>父：{{$root['name']}}</td>
                            <td>{{if $child['status']==1}}
                                <a class="blue" href="javascript:del('/{{$_controller}}/lock?id={{$child['id']}}')">
                                    <span title="点击锁定" class="badge badge-warning">正常</span></a>
                                {{else}}
                                <a class="blue" href="javascript:del('/{{$_controller}}/lock?id={{$child['id']}}')">
                                    <span title="点击解锁" class="badge">锁定</span></a> {{/if}}
                            </td>
                            <td>{{$child['sort']}}</td>
                            <td>
                                <div class="action-buttons">
                                    <a class="blue" title="功能编辑" href="/{{$_controller}}/add?id={{$child['id']}}">
                                        <i class="fa fa-pencil bigger-130"></i>
                                    </a>
                                {{if $child['status']==1}}
                                    <a	class="blue" title="点击锁定" href="javascript:del('/{{$_controller}}/lock?id={{$child['id']}}')">
                                    <i class="fa fa-unlock bigger-130"></i>
                                </a> 
                                {{else}} 
                                    <a class="blue" title="点击解锁" href="javascript:del('/{{$_controller}}/lock?id={{$child['id']}}')">
                                    <i class=" fa fa-lock bigger-130"></i></a>
                                {{/if}}

                                <a class="blue" title="删除" href="javascript:del('/{{$_controller}}/del?id={{$child['id']}}')">
                                    <i class="fa fa-trash-o bigger-130"></i>
                                </a>
                                <a class="blue" href="javascript:req('/{{$_controller}}/sort?type=up&id={{$child['id']}}')">
                                    <i class="ace-icon glyphicon glyphicon-upload" title="排序上升"></i>
                                </a>

                                <a class="blue" href="javascript:req('/{{$_controller}}/sort?type=down&id={{$child['id']}}')">
                                    <i class="ace-icon glyphicon glyphicon-download" title="排序下降"></i>
                                </a>
                                </div>
                            </td>
                        </tr>
                        {{/foreach}}
                        </tbody>
                    </table>
                </td>
                </tr>

                {{/if}}
                {{/foreach}}
                </tbody>
            </table>
        </div>
    </div>
</div>

{{* 
<div class="row">
    <div class="col-xs-12">
        <div class="dataTables_paginate paging_bootstrap">{{$pageLink}}</div>
    </div>
</div>
*}}

<script>



</script>
